package com.kede.ienum.order;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.kede.ienum.FenxiaoStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/***
 ** @Author:Pr.li
 ** @Description: NOPAY(0, " 未付款 "),
 *     PAY(1,"已付款"),
 *     BACKED(2,"已退回");
 ** @Date: create in 2023/5/16 9:01
 ***/
@Getter
@AllArgsConstructor
public enum PayStatusEnum {

    NOPAY(0,"未付款",1),
    PAY(1,"已付款",2),
    BACKED(2,"已退回",3);
    @EnumValue
    private Integer code;
    private String value;
    private Integer enumIndex;

    public static PayStatusEnum parse(Integer code) {
        for (PayStatusEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }

}
